<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="" name="form" id="form_test">
	<table>
	<tbody id="table">
		<tr>
			<td>
				<input type="file" name="aa" style="border-"> &nbsp;
				<button onclick="addfile()" >增加</button>
			</td>
			<td>
				<input type="text" name="test0" id="input_test0"> &nbsp;<br>
				<input type="text" name="test1" id="input_test1"> &nbsp;<br>
				<input type="text" name="test2" id="input_test2"> &nbsp;<br>
				<input type="text" name="test3" id="input_test3"> &nbsp;<br>
				<input type="text" name="test4" id="input_test4"> &nbsp;<br>
			</td>
		</tr>
	</tbody>
	</table>
</form>
    <script type="text/javascript">
    	var a = '123fdsacczirowhit';
    	console.log(a);
    	console.log(a.replace(/(green)|(white)/g,'red'));
    
    
    
    	//form表单唯一name值点input唯一name值
    	form.test0.value = "nihao0";
    	//form表单唯一name值点input唯一id值
    	form.input_test1.focus();
    	//form唯一id点唯一name
    	form_test.test2.value = "nihao2";
    	//form唯一id点input唯一的id
    	form_test.input_test3.value = "nihao3";
    	//input的id点value
    	//input.test4.value = "你好4";
    	var aa = /^\d{9}[+][^+]+$/;
    	console.log(aa.test("555029170+-"));
    	function addfile(){
    		var tbody = document.getElementById("table");
    		if (tbody.children.length >=3) {
				alert("最多3个");
				return;
			}
    		var tr = document.createElement("tr");
    		tr.innerHTML = "<td><input type='file' name='aa'> &nbsp;<button onclick='del(this)'>撤销</button></td>";
    		tbody.appendChild(tr);//"<tr><td><input type='file' name='aa'> &nbsp;<button onclick='del(this)'>撤销</button></td></tr>";
    	}
		function del(ff){
			ff.parentNode.parentNode.parentNode.removeChild(ff.parentNode.parentNode);
		}
	</script>
</body>
</html>